@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="isDealInfoForm">
            <div style="display: none">
                <input type="hidden" id="customerId" value="${customerId}">
                <input type="hidden" id="reservationsId" value="${consultantInfo.reservationsId}">
                <input type="hidden" id="medicalRecordNumber" value="${consultantInfo.medicalRecordNumber}">
                <input type="hidden" id="customerName" value="${consultantInfo.customerName}">
            </div>
            <div>
                病历号：${consultantInfo.medicalRecordNumber} &nbsp
                电话：${consultantInfo.customerPhone}&nbsp
                姓名：${consultantInfo.customerName}&nbsp
                性别：${consultantInfo.sex}&nbsp
                年龄：${consultantInfo.customerAge}&nbsp
                现场TC：${consultantInfo.fieldTc}
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="panel-body">
                        科室：
                    </div>
                    <div style="width:500px;height:240px;overflow:auto;" class="panel panel-success sortRight">
                        <#sortForNoDeal  id="sortForNoDeal" list="${payServiceInfoList}"/>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="row">
                        <div class="panel-body">
                            一级项目
                        </div>
                        <div id="firstLevelProjectDiv" style="width:500px;height:240px;overflow:auto;"
                             class="panel panel-success sortRight">
                        </div>
                    </div>
                </div>
            </div>
            <input disabled="disabled" id="department" value="">
            <input disabled="disabled" id="firstLevelProject" value="">
            <input type="hidden" id="payServiceId" value="">
            <div class="row">
                <label class="control-label"> 不成交原因</label>
                <div><textarea id="noDealCause" name="noDealCause" rows=5 cols=150></textarea></div>
                <div class="row btn-group-m-t">
                    <div class="col-sm-10">
                        <#button btnCss="info" name="不成交" id="deal" icon="fa-check" clickFun="IsDealInfoDlg.addNoDeal()"/>
                        <#button btnCss="info" name="取消" id="deal" icon="fa-check" clickFun="IsDealInfoDlg.close()"/>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
</div>
<link rel="stylesheet" href="${ctxPath}/static/css/jqui/jquery-ui.min.css">
<script src="${ctxPath}/static/js/jquery-ui.min.js"></script>
<script src="${ctxPath}/static/modular/tcCenter/consultant/is_deal_info.js"></script>
<script>
    var customerId = document.getElementById("customerId").value;
    $("ul#sortForNoDeal").on("click", "li", function () {
        var department = $(this).text();
        var dc = department + "," + customerId;
        $.ajax({
            url: Feng.ctxPath + "/payService/getFirstLevelProject",
            type: "post",
            data: {
                "dc": dc
            },
            success: function (data) {
                var txt = '';
                for (var i = 0; i < data.length; i++) {
                    txt += ' <div style="display: inline-block;width: 400px"> ' +
                        ' <a href=\"javascript:;\" onclick=\"getPayServiceId(\'' + data[i].firstLevelProject + '\')\">&nbsp' + data[i].firstLevelProject + '</a> ' +
                        ' </div>';
                    var customerId = data[i].customerId;
                    var department = data[i].department;
                    getPayServiceId = function (firstLevelProject) {
                        var df=department+","+firstLevelProject;
                        $.ajax({
                            url: Feng.ctxPath + "/payService/getPayServiceId",
                            type: "post",
                            data: {
                                "df": df
                            },
                            success: function (data1) {
                                document.getElementById("department").value = data1.department;
                                document.getElementById("firstLevelProject").value = data1.firstLevelProject;
                                document.getElementById("payServiceId").value = data1.id;
                            },
                            error: function (data) {
                                alert('内部故障!');
                            }
                        });
                    };
                }
                document.getElementById('firstLevelProjectDiv').innerHTML = txt;
            },
            error: function (data) {
                alert('内部故障!');
            }
        });
    })

    //点击时间框样式变化
    var dom = document.getElementById("sortPayService");
    var domchilds = document.getElementsByClassName("ui-state-default");
    dom.onclick = function (e) {
        var ev = e.event || window.event;
        for (var i = 0; i < domchilds.length; i++) {
            domchilds[i].style.borderColor = '#d3d3d3';
        }
        ev.target.style.borderColor = 'red';
    }
    openPayService = function (id) {
        var index = layer.open({
            type: 2,
            title: '收费项目详情',
            area: ['90%', '90%'], //宽高
            fix: true, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/payService/getPayServiceDetail/' + id
        });
        this.layerIndex = index;
    };

//    openUpdateMoney = function (customerId) {
//        var index = layer.open({
//            type: 2,
//            title: '收费项目详情',
//            area: ['90%', '90%'], //宽高
//            fix: true, //不固定
//            maxmin: true,
//            content: Feng.ctxPath + '/payService/openUpdateMoney/' + customerId
//        });
//        this.layerIndex = index;
//    };

</script>
@}
